package com.boxedinsoftware.betamax.smslite;


import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.preference.Preference.OnPreferenceChangeListener;

public class BetamaxSMSPrefs extends PreferenceActivity {
	
	
	SharedPreferences preferences; 
	private PreferenceScreen screen;
	
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    addPreferencesFromResource(R.xml.smsrefs);
	    
	    screen = getPreferenceScreen();
	    preferences = PreferenceManager.getDefaultSharedPreferences(this);
	    
	    
	    
	    
	    final EditTextPreference ownNumberPref = (EditTextPreference)screen.findPreference("ownNumber");
	    
	    ownNumberPref.setOnPreferenceChangeListener(new OnPreferenceChangeListener(){

			public boolean onPreferenceChange(Preference arg0, Object arg1) {
				final CheckBoxPreference ownNumberAutoPref = (CheckBoxPreference)screen.findPreference("autoFetch");
				ownNumberAutoPref.setChecked(false);
				
				return true;
			}
	    	
	    	
	    });
	    
	}

}
